package com.ce.pms.system.custservice.service.impl;

import java.util.Date;

import org.jmock.Mockery;

import com.ce.pms.common.dao.ISysrefcodeDao;
import com.ce.pms.common.model.SysInfo;
import com.sitechasia.webx.core.utils.base.PopulateUtil;

import junit.framework.TestCase;

/**
 * 描述：“客户事件业务配置”测试，使用jmock的基类
 * @author 王浩羽
 *
 */
public class MyJMockBaseTestCase extends TestCase
{
	protected Mockery context = new Mockery();
	protected ISysrefcodeDao sysrefcodeDao;
	protected final Long SYSTEM_INFO_CREATER  = 5L;
	protected final Long SYSTEM_INFO_MODIFIER = 6L;
	protected final Long SYSTEM_INFO_NEW_MODIFIER = 7L;
	protected final Date SYSTEM_INFO_DATE_CREATED = new Date();
	protected final Date SYSTEM_INFO_DATE_MODIFIED = new Date();
	
	protected SysInfo sysInfo;
	
	public void setUp() throws Exception{
		super.setUp();
		sysrefcodeDao = context.mock(ISysrefcodeDao.class);
		sysInfo = new SysInfo();
		sysInfo.setCreator(SYSTEM_INFO_CREATER);
		sysInfo.setModifier(SYSTEM_INFO_MODIFIER);
		sysInfo.setModifyDate(SYSTEM_INFO_DATE_CREATED);
		sysInfo.setModifyDate(SYSTEM_INFO_DATE_MODIFIED);
	}
	
	protected Object copyData(Object source, Object target, String... ignoreProperties){
		PopulateUtil.populate(source, target,ignoreProperties);
		return target;
	}
	
	protected Object copyData(Object source, Object target){
		return copyData(source, target,null);
	}
}
